package com.xuexiang.xuidemo.slice;

import com.xuexiang.xui_lib.component.progress.loading.ARCLoadingView;
import com.xuexiang.xuidemo.ResourceTable;
import com.xuexiang.xuidemo.slice.edittext.CustomEditAbilitySlice;
import com.xuexiang.xuidemo.slice.edittext.EditStyleAbilitySlice;
import com.xuexiang.xuidemo.slice.edittext.MeterialEditAbilitySlice;
import com.xuexiang.xuidemo.slice.edittext.VeriftEditAbilitySlice;
import com.xuexiang.xuidemo.slice.progress.*;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;
import ohos.agp.utils.Color;

public class ProgressBarAbilitySlice extends AbilitySlice implements Component.ClickedListener {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_progress_bar);
        findComponentById(ResourceTable.Id_progress_bar_ARCLoadingView_btn).setClickedListener(this);
        findComponentById(ResourceTable.Id_progress_bar_backImage).setClickedListener(this);
        findComponentById(ResourceTable.Id_progress_bar_RotateLoadingView_btn).setClickedListener(this);
        findComponentById(ResourceTable.Id_progress_bar_MaterialProgressBar_btn).setClickedListener(this);
        findComponentById(ResourceTable.Id_progress_bar_DeterminateCircular_btn).setClickedListener(this);
        findComponentById(ResourceTable.Id_progress_bar_RatingBar_btn).setClickedListener(this);
        findComponentById(ResourceTable.Id_progress_bar_beautiful).setClickedListener(this);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }

    @Override
    public void onClick(Component component) {
        switch (component.getId()){
            case ResourceTable.Id_progress_bar_ARCLoadingView_btn:
                present(new ArcLoadingViewSlice(),new Intent());
                break;
            case ResourceTable.Id_progress_bar_RotateLoadingView_btn:
                present(new RotateLoadingViewSlice(),new Intent());
                break;
            case ResourceTable.Id_progress_bar_MaterialProgressBar_btn:
                present(new MaterialProgressBarSlice(),new Intent());
                break;
            case ResourceTable.Id_progress_bar_DeterminateCircular_btn:
                present(new DeterminateCircularSlice(),new Intent());
                break ;
            case ResourceTable.Id_progress_bar_RatingBar_btn:
                present(new RatingBarSlice(),new Intent());
                break;
            case ResourceTable.Id_progress_bar_beautiful:
                present(new BeautifulProgressBarSlice(),new Intent());
                break;
            case  ResourceTable.Id_progress_bar_backImage:
                terminate();
                break;
        }
    }
}
